Target Group
💡 Definition
A Target Group is a logical grouping of targets (such as EC2 instances, Lambda functions, or IP addresses) that an Elastic Load Balancer routes traffic to.
🔑 Key Concepts
- Destination: It tells the load balancer where to send traffic.
- Protocol & Port: You define the protocol (e.g., HTTP) and port (e.g., 80) for the traffic sent to the targets.
- Health Checks: You define the health check settings (path, timeout, interval). The load balancer runs these checks on the Target Group to determine which targets are healthy.
- Registration: Targets (like instances) are registered with the Target Group. Auto Scaling Groups can automatically register new instances with a Target Group.
⚙️ How it Works
- Create: Create a Target Group specifying Protocol (HTTP), Port (80), and VPC.
- Define Health Check: e.g., "Ping
/healthevery 30 seconds". - Associate: Associate the Target Group with a Listener Rule on an Application Load Balancer.
- Register: Register instances (manually or via ASG).
🎯 Use Cases
- Routing: Sending API traffic to an "API Target Group" and web traffic to a "Web Target Group".
- Blue/Green Deployment: creating a new Target Group for the new version of your app and shifting traffic to it.
💰 Pricing Model
- There is no additional charge for Target Groups; they are a configuration component of the Load Balancer service.
📝 Exam Tips (CLF-C02)
- Used by Application Load Balancers and Network Load Balancers.
- This is where Health Checks are configured.
- It's the "glue" between the Load Balancer and the backend instances.
See Also: * Application Load Balancer * Load Balancer * Auto Scaling